# coding:utf-8
"""
    Create time : 2020/11/4 - 10:03
    Author : Jimy
    Email : 1650015040@qq.com
"""
import model
import controller
import view

def get_student_data_from_db():
    # 新建模型
    student_model = model.StudentModel()
    # 设置值
    student_model.set_name("Jerry")
    student_model.set_age(26)
    return student_model

def main():
    # 设置数据
    data_model = get_student_data_from_db()
    data_view = view.StudentView()

    # 直接接触:Controller
    new_controller = controller.StudentController(data_model,data_view)
    new_controller.update_view()

    print("---------------更新数据-------------------")
    # new_model =
    data_model.set_name("Python Web 666")
    data_model.set_age(999999)
    controller22 = controller.StudentController(data_model,data_view)
    controller22.update_view()



if __name__ == '__main__':
    main()
